package com.catal.framework.data;


public class And extends Condition{
	private Condition rightCondition;
	private Condition leftCondition;
	
	private String andDesc;
	
	public And(){
		
	}
	
	/**
	 * 
	 * @param leftCondition	and左边源条件
	 * @param rightCondition	and右边的条件
	 */
	public And(Condition leftCondition, Condition rightCondition){
		this.leftCondition = leftCondition;
		this.rightCondition = rightCondition;
	}
	
	@Override
	public void setLeftCondition(Condition condition) {
		this.leftCondition = condition;
	}

	public Condition getLeftCondition() {
		return leftCondition;
	}

	public Condition getRightCondition() {
		return rightCondition;
	}

	public void setRightCondition(Condition rightCondition) {
		this.rightCondition = rightCondition;
	}
	
	public String toString(){
		StringBuffer buffer = new StringBuffer(this.leftCondition.toString());
		buffer.append(" AND ").append(rightCondition);
		return buffer.toString();
	}

	public String getAndDesc() {
		return andDesc;
	}

	public void setAndDesc(String andDesc) {
		this.andDesc = andDesc;
	}

}
